package com.chatplus.application.web;

import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 审计日志配置
 *
 * @author chj
 * @date 2022/6/28
 **/
@Configuration
public class AuditLoggerFilterConfiguration {

    @Bean
    @ConfigurationProperties("chatplus.audit-logger")
    @ConditionalOnProperty(prefix = "chatplus.audit-logger", name = "enable", havingValue = "true")
    public AuditLoggerProperties auditLoggerProperties() {
        return new AuditLoggerProperties();
    }
    @Data
    public static class AuditLoggerProperties {

        private boolean enable = true;
    }
}
